package com.lyf.service;

import java.util.List;

import com.lyf.dao.MaterialDao;
import com.lyf.pojo.Material;

public class MaterialService {

	private MaterialDao dao;

	//set,
	public void setDao(MaterialDao dao) {
		this.dao = dao;
	}

	//method
	public void save(Material material) {
		dao.saveOrUpdate(material);
	}
	
	public List<Material> findAll(){
		return dao.findAllByOrder("desc", "m_createTime");
	}
	
	public Material findById(String id){
		return dao.get(id);
	}

	public void delete(String id) {
		dao.delete(id);
	}
	
	
}
